{% extends 'carry/layout.html' %}
{% load static %}
{% load carry_list %}
{% load rbac %}

{% block css %}
	<link rel="stylesheet" href="{% static 'carry/plugins/footable/css/footable.core.css' %}">
	<style>
		.row {
			margin: 5px 15px;
		}

		.comb-search .row .whole {
			width: 60px;
			float: left;

		}

		.comb-search .row .others {
			padding-left: 60px;
		}

		.comb-search .row a {
			display: inline-block;
			padding: 5px 8px;
			margin: 3px;
			border: 1px solid #d4d4d4;

		}

		.comb-search .row a {
			display: inline-block;
			padding: 5px 8px;
			margin: 3px;
			border: 1px solid #d4d4d4;
		}

		.comb-search a.active {
			color: #fff;
			background-color: #337ab7;
			border-color: #2e6da4;
		}
	</style>
{% endblock %}


{% block content %}
	<div id="page-title">
		<h2 class="page-header text-overflow">
			{% title_pre request %}
		</h2>
		<!--Searchbox-->
		<div class="searchbox">
			<div class="input-group custom-search-form">
				<input id="filter" type="text" class="form-control" placeholder="Search..">
				<span class="input-group-btn">
                                <button class="text-muted" type="button"><i class="demo-pli-magnifi-glass"></i></button>
                            </span>
			</div>
		</div>
	</div>
	<div id="page-content">
		<div class="container">
			<h1>数据列表</h1>
			{% if change_list.list_filter %}
				<div class="comb-search">
					{% for row in change_list.gen_list_filter %}
						<div class="row">
							{% for col in row %}
								{% if forloop.first %}
									{{ col }}
								{% else %}
									{{ col }}
								{% endif %}

							{% endfor %}
						</div>
					{% endfor %}
				</div>
			{% endif %}
			<form method="post" class="form-horizontal">
				{% csrf_token %}
				<div class="row" style="padding: 5px 0">
					<!-- 定制Action -->
					{% if change_list.actions %}
						{% show_action change_list %}
					{% endif %}
					<!-- 添加按钮 -->
					{{ change_list.add_btn|safe }}
				</div>
				<div class="row">
					<!-- 数据表格 -->
					{% show_result_list change_list %}
					<div style="text-align: center">
						<ul class="pagination" style="margin: 0 auto;">
							{{ change_list.pager.page_html|safe }}
						</ul>
					</div>
				</div>
			</form>
		</div>
	</div>

{% endblock %}

{% block js %}
	<script src="{% static 'carry/plugins/footable/js/footable.js' %}" type="text/javascript"></script>
	<script src="{% static 'carry/plugins/footable/js/footable.sort.js' %}" type="text/javascript"></script>
	<script src="{% static 'carry/plugins/footable/js/footable.filter.js' %}" type="text/javascript"></script>
	<script>
        $(function () {
            $('#headCheckBox').click(function () {
                $(this).parent().parent().parent().next().find(':checkbox').prop('checked', $(this).prop('checked'));
            });
            $(".footable").footable();
        })
	</script>
{% endblock %}